package com.cx.core.magazine.service;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import com.cx.core.magazine.model.bean.Article;
import com.cx.core.magazine.model.bean.Period;
import com.li.core.RequestEnvelope;
import com.li.core.ResponseEnvelope;
/**
 * 
 * @author li.chh
 *
 */
public interface MagazineManageService {

	/**
	 * 查询所有的期别信息
	 * 
	 * @return
	 */
	public ResponseEnvelope<String, String> queryAllPeriods(RequestEnvelope<String,String> rqs) throws Exception;

	/**
	 * 查询期别信息
	 * 
	 * @param rqs
	 *           pagenum       页面编号
	 *           loadimageflag 是否加载图像
	 * @return
	 */
	public ResponseEnvelope<String, String> queryPeriods(RequestEnvelope<String,String> rqs) throws Exception;

	/**
	 * 根据期别查询文章信息
	 * 
	 * @param rqs
	 * 		period 期别编号
	 * 		loadimageflag 是否加载图像
	 * @return
	 */
	public ResponseEnvelope<String, String> queryArticlesByPeriod(
			RequestEnvelope<String,String> rqs) throws Exception;
	/**
	 * 查询年度列表
	 * 
	 * @param 
	 * @return
	 */
	public ArrayList<String> queryYears() throws Exception;
	/**
	 * 查询年度期数列表
	 * 
	 * @param 
	 * @return
	 */
	public List<Period> queryPeriods(int year) throws Exception;
	/**
	 * 保存照片
	 * 
	 * @param 
	 * @return
	 */
	public String saveArticle(Article article) throws Exception;
	/**
	 * 查询articleForm
	 * @param rqs
	 * @return
	 * @throws Exception
	 */
	public ResponseEnvelope<String, String> queryFrontArticlesByPeriod(
			RequestEnvelope<String, String> rqs) throws Exception;
	/**
	 * 更新报导
	 * @param 
	 * @return
	 */
	public String updateArticle(Article article) throws Exception;
	/**
	 * 保存圖片
	 * @param filename
	 * @param bytes
	 * @return 圖片id
	 * @throws Exception
	 */
	public int saveImage(String filename,byte[] bytes) throws Exception;
	/**
	 * 删除报道
	 * @param id
	 * @throws Exception
	 */
	public void deleteArticle(int id) throws Exception;
	/**
	 * 删除图片
	 * @param image_id
	 * @throws Exception
	 */
	public void deleteImage(String image_id) throws Exception;

}
